package d06_collection_quickstart;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        //1.创建集合
        Collection<String> col = new ArrayList<>();
        col.add("苍老师");
        col.add("波多老师");
        col.add("小泽老师");
        col.add("冲田老师");
        col.add("饭老师");
        Iterator<String> iterator = col.iterator();
        while (iterator.hasNext()) {
            String name = iterator.next();
            System.out.println(name);
        }
        for (String name : col) {
            System.out.println(name);
        }


    }
}
